package com.example.chatweb.controller;

import com.example.chatweb.entity.Topic;
import com.example.chatweb.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class TopicController {


    private final TopicService topicService;


    @Autowired
    public TopicController(TopicService topicService) { this.topicService = topicService; }

    @PostMapping("/add_topic")
    public void insert(@RequestBody Topic topic){ this.topicService.addtopic(topic); }


}
